Between the GTK4 port and the latest GTK4 version, calling realize()
on a newly created window to force its surface to be created stopped
working.
So instead, wait for the window to get realized regularly to set its
parent.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1574>
const extension = ExtensionUtils.deserializeExtension(serialized);
const window = new ExtensionPrefsDialog(extension);
- window.realize();
+ window.connect('realize', () => {
+ let externalWindow = null;
- let externalWindow = null;
+ if (parentWindow)
+ externalWindow = Shew.ExternalWindow.new_from_handle(parentWindow);
- if (parentWindow)
- externalWindow = Shew.ExternalWindow.new_from_handle(parentWindow);
-
- if (externalWindow)
- externalWindow.set_parent_of(window.get_surface());
+ if (externalWindow)
+ externalWindow.set_parent_of(window.get_surface());
+ });
if (options.modal)
window.modal = options.modal.get_boolean();